import type { RouteRecordRaw } from 'vue-router'

const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/search',
  },
  {
    name: 'home',
    path: '/home',
    component: () => import('@/views/home/index.vue'),
    // 区分是home还是search
    meta: {
      isHiddenNav: true,
    },
  },
  {
    name: 'search',
    path: '/search/:keyword?',
    component: () => import('@/views/search/index.vue'),
  },
  {
    name: 'detail',
    path: '/detail/:id',
    component: import('@/views/detail'),
  },
  {
    name: 'shopCart',
    path: '/shopCart',
    component: import('@/views/shopCart'),
  },
  {
    name: 'trade',
    path: '/trade',
    component: () => import('@/views/Trade'),
  },
  {
    name: 'pay',
    path: '/pay',
    component: () => import('@/views/Pay'),
  },
  {
    name: 'center',
    path: '/center',
    component: () => import('@/views/Center'),
  },
  {
    name: 'paySuccess',
    path: '/paySuccess',
    component: () => import('@/views/PaySuccess'),
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      hidden: true,
    },
  },
  {
    name: 'register',
    path: '/register',
    component: import('@/views/register'),
    meta: {
      hidden: true,
    },
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      hidden: true,
    },
  },
]

export default staticRoutes
